/*
 * @Author: your name
 * @Date: 2022-01-31 15:18:29
 * @LastEditTime: 2022-02-04 21:53:06
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue3-ts-food-admin\src\main.ts
 */
import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router/router";
import Elementplus from "element-plus";
import * as ElementIcons from "@element-plus/icons-vue";

import "element-plus/dist/index.css";
import "./styles/commons.less";

function transElIconName(iconName) {
  return (
    "elicon" + iconName.replace(/[A-Z]/g, (match) => "-" + match.toLowerCase())
  );
}

const app = createApp(App);
app.use(Elementplus);
app.use(router);
for (let iconName in ElementIcons) {
  app.component(transElIconName(iconName), ElementIcons[iconName]);
}
app.mount("#app");
